<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <th:block th:include="common.html :: source"></th:block>
</head>
<body>

<th:block th:include="common.html :: header"></th:block>

<div class="i_bg bg_color">
    <div class="m_content">

        <div class="m_left">
            <div class="left_n">管理中心</div>
            <div class="left_m">
                <div class="left_m_t t_bg1">订单中心</div>
                <ul>
                    <li><a href="/orderList">我的订单</a></li>
                </ul>
            </div>
            <div class="left_m">
                <div class="left_m_t t_bg2">会员中心</div>
                <ul>
                    <li><a href="/userInfo">用户信息</a></li>
                    <li><a href="/userAddressList">地址管理</a></li>
                </ul>
            </div>
            <div class="left_m">
                <div class="left_m_t t_bg1">积分中心</div>
                <ul>
                    <li><a href="/integralList">我的积分</a></li>
                </ul>
            </div>
            <div class="left_m">
                <div class="left_m_t t_bg2">后台管理</div>
                <ul>
                    <li>
                        <input id="userType" type="hidden" th:value="${session.user.type}">
                        <a href="javascript:void(0)" onclick="toBack()">后台信息</a>
                    </li>
                </ul>
                <script type="text/javascript">
                    function toBack() {
                        let userType = $("#userType").val();
                        if (userType === 'false') {
                            alert("权限不足，请联系管理员！");
                            return false;
                        }
                        window.location.href = "/back/main";
                    }
                </script>
            </div>
        </div>

        <div class="m_right">
            <p></p>
            <div class="mem_tit">修改信息</div>
            <div>
                <form style="font-size: 15px;margin-left: 100px;" action="/user/userInfoUpdate" method="post">
                    <table border="0" style="width:370px; font-size:14px; margin-top:30px;" cellspacing="0"
                           cellpadding="0">
                        <tr height="50">
                            <td>登录名</td>
                            <td><input type="text" name="loginName" th:value="${userInfo.loginName}"
                                       pattern="^[A-Za-z0-9]{5,}$"
                                       title="用户名由大于等于5位字母和数字组成"/></td>
                        </tr>
                        <tr height="50">
                            <td>用户名</td>
                            <td><input type="text" name="userName" th:value="${userInfo.userName}"
                                       pattern="^[\u4e00-\u9fa5]+$"
                                       title="请输入正确的姓名"/></td>
                        </tr>
                        <tr height="50">
                            <td>密码</td>
                            <td><input type="password" name="password" pattern="^[a-zA-Z0-9]{6,10}$"
                                       title="密码由6-10位字母和数组组成"/></td>
                        </tr>
                        <tr height="50">
                            <td>性别</td>
                            <td>
                                <input type="radio" name="gender" value="1"
                                       th:checked="${userInfo.gender} == 1"/>男&nbsp;
                                <input type="radio" name="gender" value="0"
                                       th:checked="${userInfo.gender} == 0"/>女
                            </td>
                        </tr>
                        <tr height="50">
                            <td>身份证</td>
                            <td><input type="text" name="identityCode" th:value="${userInfo.identityCode}"
                                       pattern="(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)" title="请输入正确的身份证号"/></td>
                        </tr>
                        <tr height="50">
                            <td>邮箱</td>
                            <td><input type="text" name="email" th:value="${userInfo.email}"
                                       pattern="^\w+@\w+(\.\w+){1,2}$"
                                       title="请输入正确的邮箱"/></td>
                        </tr>
                        <tr height="50">
                            <td>电话</td>
                            <td><input type="text" name="mobile" th:value="${userInfo.mobile}"
                                       pattern="^(13|15|18)\d{9}$"
                                       title="请输入正确的手机"/></td>
                        </tr>
                        <tr height="50">
                            <td></td>
                            <td><input type="submit" value="提交"/></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
</div>

<th:block th:include="common.html :: footer"></th:block>
<th:block th:include="common.html :: permit"></th:block>

</body>
</html>